#pragma once

#include "Types.h"

struct DisplayMode
{
	enum StyleEnum {
		MaskOnly,	///< only mask in black-white pallete is shown
		ObjectOnly,
		BackgroundOnly,
		MattedObject, ///< background is ignored
		Composition ///< composition of object and background (shall not be choosen if there is no background)
	};
	StyleEnum Style;

	// not for ObjectOnly and BackroundOnly
	bool SmoothMask; /// true=soft, false=crisp
	bool InverseMask;

	/// Only for MattedObject style.
	/// In the same time it's background color if no background footage is loaded;
	/// alpha component contains opacity of matte: 0 - transparent, 255 - opaque
	ByteColor MatteColor;

	/// If RamPreview is true, then composed frames are stored in memory cache;
	/// If memory cache is large enough to contain all frames of work area,
	/// then it's speedups playback; otherwise --- slowdowns.
	bool RamPreview; 

public:
	void WriteSettings();
	void ReadSettings();
};

/// comparison of equality of visual effect
bool operator == (const DisplayMode & lhs, const DisplayMode & rhs);

inline bool operator != (const DisplayMode & lhs, const DisplayMode & rhs)
	{ return !(lhs == rhs); }
